package com.youhong.teethcare.settingpage;

import android.app.Activity;
import android.app.Application;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.youhong.teethcare.BaseActivity;
import com.youhong.teethcare.R;
import com.youhong.teethcare.services.Common;

public class AboutUsActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);
        initStatusBar(getResources().getColor(R.color.pageBackground),true);

        getViews();
    }


    TextView tv_version;
    ImageView iv_back;
    RelativeLayout rl1, rl2, rl3, rl4, rl5;


    private void getViews() {

        rl1 = findViewById(R.id.aboutUs_rl1);
        rl1.setOnClickListener(this);


        rl2 = findViewById(R.id.aboutUs_rl2);
        rl2.setOnClickListener(this);

        rl3 = findViewById(R.id.aboutUs_rl3);
        rl3.setOnClickListener(this);

        rl4 = findViewById(R.id.aboutUs_rl4);
        rl4.setOnClickListener(this);

        rl5 = findViewById(R.id.aboutUs_rl5);
        rl5.setOnClickListener(this);


        iv_back = findViewById(R.id.aboutUs_iv_back);
        iv_back.setOnClickListener(this);
        tv_version = findViewById(R.id.aboutUs_tv_version);


        tv_version.setText(tv_version.getText()
                + Common.appVersion);
    }

    @Override
    public void onClick(View v) {

        if (v == iv_back) {

            this.finish();

        } else if (v == rl1) {

            Intent intent = new Intent(getApplicationContext(), AboutUsDetailActivity.class);
            intent.putExtra("index", 1);
            startActivity(intent);

        } else if (v == rl2) {

            Intent intent = new Intent(getApplicationContext(), AboutUsDetailActivity.class);
            intent.putExtra("index", 2);
            startActivity(intent);
        } else if (v == rl3) {

            Intent intent = new Intent(getApplicationContext(), AboutUsDetailActivity.class);
            intent.putExtra("index", 3);
            startActivity(intent);
        } else if (v == rl4) {

            Intent intent = new Intent(getApplicationContext(), AboutUsDetailActivity.class);
            intent.putExtra("index", 4);
            startActivity(intent);

        } else if (v == rl5) {

            Intent intent = new Intent(getApplicationContext(), AboutUsDetailActivity.class);
            intent.putExtra("index", 5);
            startActivity(intent);

        }
    }
}
